﻿@using Covenant.Models.Listeners
@model IEnumerable<Profile>

<div class="table-responsive">
    <table id="profiles-table" class="table table-hover">
        <thead>
            <tr>
                <th>@Html.DisplayNameFor(model => model.Name)</th>
                <th>@Html.DisplayNameFor(model => model.Description)</th>
                <th>@Html.DisplayNameFor(model => model.Type)</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        <a asp-controller="Profile" asp-action="Edit" asp-route-id="@item.Id">
                            @Html.DisplayFor(modelItem => item.Name)
                        </a>
                    </td>
                    <td>@Html.DisplayFor(modelItem => item.Description)</td>
                    <td>@Html.DisplayFor(modelItem => item.Type)</td>
                </tr>
            }
        </tbody>
    </table>
</div>
@if (User.IsInRole("Administrator"))
{
    <a asp-controller="Profile" asp-action="Create" class="btn btn-primary">
        <span data-feather="plus"></span>
        Create
    </a>
}